package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.AnswerQuestion;
import cn.wolfcode.trip.base.mapper.AnswerQuestionMapper;
import cn.wolfcode.trip.base.service.IAnswerQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class AnswerQuestionServiceImpl implements IAnswerQuestionService {
    @Autowired
    private AnswerQuestionMapper answerQuestionMapper;

    @Override
    public List<AnswerQuestion> listAllByQuizzerId(Long questionId) {
        return answerQuestionMapper.selectAllByQuizzerId(questionId);
    }

    @Override
    public void save(AnswerQuestion answerQuestion) {
        answerQuestion.setCreateTime(new Date());
        answerQuestionMapper.insert(answerQuestion);
    }
}
